﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace BTv2.Model
{
    public abstract class Condition : INotifyPropertyChanged
    {


        public event PropertyChangedEventHandler PropertyChanged;

        // This method is called by the Set accessor of each property. 
        // The CallerMemberName attribute that is applied to the optional propertyName 
        // parameter causes the property name of the caller to be substituted as an argument. 
        protected void NotifyPropertyChanged([CallerMemberName] String propertyName = "")
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

       public string Name
       {
           get
           {
               return ParseCondition();
           }
       }

       public Condition Parent
       {
           get;
           set;
       }
       public abstract Condition Copy();
       public string XamlName{get;set;}
       public abstract string ParseCondition();
       public abstract Task<bool> EvaluateCondition();
       public abstract string ParseSQLCondition();
    }
}
